/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package database;

import java.sql.Connection;
import java.sql.Statement;
import javax.swing.JOptionPane;
import oracle.jdbc.pool.OracleDataSource;

/**
 *
 * @author BENY as User
 */
public class Hapus_tabel {

    public static void main(String[] args) {
        String url = "jdbc:oracle:thin:@localhost:1521:XE";
        String name = "hr";
        String pass = "sisil";
        Connection con;
        try {
            OracleDataSource ods = new OracleDataSource();
            ods.setURL(url);
            con = ods.getConnection(name, pass);
            Statement stat = con.createStatement();
            String hapus1 = "DROP TABLE SURAT";
            stat.executeQuery(hapus1);
            String hapus2 = "DROP TABLE DOKUMEN";
            stat.executeQuery(hapus2);
            String hapus3 = "DROP TABLE DOSEN";
            stat.executeQuery(hapus3);
            String hapus4 = "DROP TABLE CACHE";
            stat.executeQuery(hapus4);
            JOptionPane.showMessageDialog(null, "tabel berhasil dihapus");
        } catch (Exception e) {
            JOptionPane.showMessageDialog(null, "error");
        }
    }
}
